package com.jasmine.bjstkserver.core.config;

import com.jasmine.bjstkserver.core.config.support.DictRunner;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @author jasmineXz
 */
@Configuration
public class BjstkConfiguration {

    /**
     * 系统启动执行
     */
    @Bean
    public ApplicationRunner dictRunner(){
        return new DictRunner();
    }


    /**
     * 定时任务线程池
     */
    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
        taskScheduler.setPoolSize(4);
        return taskScheduler;
    }
}
